// 客户资料
<template>
  <div class="app-container">
    <el-container>
      <el-main>
        <div ref="borrow">
          <el-row class="bgc">
            <el-col :span="24"> 个人概况</el-col>
          </el-row>
          <el-form :label-position="labelPosition" label-width="160px" :model="loanInfo" :inline="true">
            <el-form-item label="客户名称">
              <el-input v-model="loanInfo.custName" disabled />
            </el-form-item>
            <el-form-item label="客户类型">
              <el-input v-model="loanInfo.custType" disabled />
            </el-form-item>
            <el-form-item label="证件类型">
              <el-input v-model="loanInfo.custType" disabled />
            </el-form-item>
            <el-form-item label="证件号码">
              <el-input v-model="loanInfo.certNumber" disabled />
            </el-form-item>
            <el-form-item label="性别">
              <el-input v-model="loanInfo.sex" disabled />
            </el-form-item>
            <el-form-item label="证件到期日">
              <el-date-picker v-model="loanInfo.certExpire" type="date" placeholder="请选择日期" disabled />
            </el-form-item>
            <el-form-item label="居民属性">
              <el-input v-model="loanInfo.residentAttr" disabled> </el-input>
            </el-form-item>
            <el-form-item label="国籍">
              <el-input v-model="loanInfo.nation" disabled> </el-input>
            </el-form-item>
            <el-form-item label="职业状况">
              <el-input v-model="loanInfo.jobStatus" disabled> </el-input>
            </el-form-item>
          </el-form>
        </div>

        <div ref="bank">
          <el-row class="bgc">
            <el-col :span="24">基础信息</el-col>
          </el-row>
          <el-form :label-position="labelPosition" label-width="160px" :model="loanInfo" :inline="true">
            <el-form-item label="婚姻状况">
              <el-select v-model="loanInfo.maritalStatus" class="m-2" placeholder="Select" size="large" disabled>
                <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
              </el-select>
              <!-- <el-input v-model="loanInfo.maritalStatus" /> -->
            </el-form-item>
            <el-form-item label="年收入">
              <el-input v-model="loanInfo.yearIncome" disabled />
            </el-form-item>
            <el-form-item label="单位名称">
              <el-input v-model="loanInfo.compName" disabled />
            </el-form-item>
            <el-form-item label="职务">
              <el-input v-model="loanInfo.job" disabled />
            </el-form-item>
            <el-form-item label="工作单位地址">
              <el-input v-model="loanInfo.compAddress" disabled />
            </el-form-item>
            <el-form-item label="工作单位性质">
              <el-input v-model="loanInfo.compNature" disabled />
            </el-form-item>
            <el-form-item label="是否有本地房产">
              <el-switch v-model="loanInfo.isLocalHouse" class="mb-2" active-text="是" inactive-text="否" active-value="true" inactive-value="false" disabled />
            </el-form-item>
            <el-row class="bgc">
              <el-col :span="24">联系地址信息</el-col>
            </el-row>
            <el-form-item label="地址类型">
              <el-input v-model="loanInfo.addressType" disabled />
            </el-form-item>
            <el-form-item label="是否通讯地址">
              <el-switch v-model="loanInfo.isMailAddress" class="mb-2" active-text="是" inactive-text="否" active-value="true" inactive-value="false" disabled />
            </el-form-item>
            <el-form-item label="地址所属国家/区域">
              <el-input v-model="loanInfo.homeCountry" disabled />
            </el-form-item>
            <el-form-item label="地址所属区/县">
              <el-input v-model="loanInfo.homeRegion" disabled />
            </el-form-item>
            <el-form-item label="地址详情">
              <el-input v-model="loanInfo.homeDetail" disabled />
            </el-form-item>
            <el-row class="bgc">
              <el-col :span="24">联系电话信息</el-col>
            </el-row>
            <el-form-item label="电话类型">
              <el-input v-model="loanInfo.phoneType" disabled />
            </el-form-item>
            <el-form-item label="国际区号">
              <el-input v-model="loanInfo.interAreaCode" disabled />
            </el-form-item>
            <el-form-item label="电话号码">
              <el-input v-model="loanInfo.phoneNumber" disabled />
            </el-form-item>
            <el-form-item label="是否为短信接收号码">
              <el-switch v-model="loanInfo.isShortMsg" class="mb-2" active-text="是" inactive-text="否" active-value="true" inactive-value="false" disabled />
              <!-- <el-input v-model="loanInfo.branchName" /> -->
            </el-form-item>
            <el-form-item label="备注">
              <el-input v-model="loanInfo.remark" type="textarea" disabled />
            </el-form-item>
            <el-row class="bgc">
              <el-col :span="24">其他信息</el-col>
            </el-row>
            <el-form-item label="学历">
              <el-input v-model="loanInfo.education" disabled />
            </el-form-item>
            <el-form-item label="年龄">
              <el-input v-model="loanInfo.age" disabled />
            </el-form-item>
            <el-form-item label="电话号码2">
              <el-input v-model="loanInfo.phoneNum2" disabled />
            </el-form-item>
            <el-form-item label="是否有子女">
              <el-switch v-model="loanInfo.isChildren" class="mb-2" active-text="是" inactive-text="否" active-value="true" inactive-value="false" disabled />
              <!-- <el-input v-model="loanInfo.branchName" /> -->
            </el-form-item>
            <el-form-item label="邮箱">
              <el-input v-model="loanInfo.email" disabled />
            </el-form-item>
            <el-form-item label="微信">
              <el-input v-model="loanInfo.weChat" disabled />
            </el-form-item>
            <el-form-item label="qq">
              <el-input v-model="loanInfo.qq" disabled />
            </el-form-item>
            <el-form-item label="家人是否知晓">
              <el-switch v-model="loanInfo.familyKnow" class="mb-2" active-text="是" inactive-text="否" active-value="true" inactive-value="false" disabled />
              <!-- <el-input v-model="loanInfo.branchName" /> -->
            </el-form-item>
            <el-form-item label="住宅电话">
              <el-input v-model="loanInfo.homePhone" disabled />
            </el-form-item>
            <el-form-item label="居住时长">
              <el-input v-model="loanInfo.residenceDuration" disabled />
            </el-form-item>
            <el-form-item label="房产数量">
              <el-input v-model="loanInfo.realEstateNumber" disabled />
            </el-form-item>
            <el-form-item label="车数量">
              <el-input v-model="loanInfo.phoneNum2" disabled />
            </el-form-item>
            <el-form-item label="车产">
              <el-input v-model="loanInfo.carNumber" disabled />
            </el-form-item>
            <el-form-item label="配偶姓名">
              <el-input v-model="loanInfo.spouseName" disabled />
            </el-form-item>
            <el-form-item label="配偶工作单位">
              <el-input v-model="loanInfo.spouseWorkUnit" disabled />
            </el-form-item>
            <el-form-item label="配偶电话">
              <el-input v-model="loanInfo.mobilePhone1" disabled />
            </el-form-item>
            <el-form-item label="直系亲属姓名">
              <el-input v-model="loanInfo.immediateFamilyName" disabled />
            </el-form-item>
            <el-form-item label="直系亲属电话">
              <el-input v-model="loanInfo.mobilePhone2" disabled />
            </el-form-item>
            <el-form-item label="直系亲属关系">
              <el-input v-model="loanInfo.immediateFamilyRelationship" disabled />
            </el-form-item>
            <el-form-item label="其他联系人姓名">
              <el-input v-model="loanInfo.otherContactsName" disabled />
            </el-form-item>
            <el-form-item label="其他联系人关系">
              <el-input v-model="loanInfo.otherContactsRelationship" disabled />
            </el-form-item>
            <el-form-item label="其他联系人电话">
              <el-input v-model="loanInfo.mobilePhone3" disabled />
            </el-form-item>
            <el-form-item label="其他联系人工作单位">
              <el-input v-model="loanInfo.immediateFamilyWorkUnit" disabled />
            </el-form-item>
            <el-form-item label="参与工作时间">
              <el-input v-model="loanInfo.workingHours" disabled />
            </el-form-item>
            <el-form-item label="单位电话">
              <el-input v-model="loanInfo.workTelephone" disabled />
            </el-form-item>
            <el-form-item label="现单位名称">
              <el-input v-model="loanInfo.currentUnitName" disabled />
            </el-form-item>
            <el-form-item label="是否缴纳社保">
              <el-switch v-model="loanInfo.isSocialSecurity" class="mb-2" active-text="是" inactive-text="否" active-value="true" inactive-value="false" disabled />
            </el-form-item>
            <el-form-item label="是否缴纳公积金">
              <el-switch v-model="loanInfo.isAccumulationFund" class="mb-2" active-text="是" inactive-text="否" active-value="true" inactive-value="false" disabled />
            </el-form-item>
            <el-form-item label="现单位职位">
              <el-input v-model="loanInfo.currentPosition" disabled />
            </el-form-item>
            <el-form-item label="入职时间">
              <el-input v-model="loanInfo.entryTime" disabled />
            </el-form-item>
          </el-form>
        </div>

        <div ref="identity">
          <el-row class="bgc">
            <el-col :span="24">身份认证信息</el-col>
          </el-row>
          <el-form :label-position="labelPosition" label-width="100px" :model="loanInfo" :inline="true">
            <el-form-item label="身份证正/反面">
              <el-image style="width: 100px; height: 100px" :src="frontUrl" :zoom-rate="1.2" :preview-src-list="frontList" :initial-index="0" fit="cover" />
            </el-form-item>
            <el-form-item label="手持身份证" style="max-width: 460px">
              <el-image style="width: 100px; height: 100px" :src="versoUrl" :zoom-rate="1.2" :preview-src-list="versoList" :initial-index="0" fit="cover" />
            </el-form-item>
          </el-form>
        </div>
        <!-- <el-row style="margin-bottom: 10px">
          <el-col :span="12" :offset="10"> <el-button type="primary" @click="onSubmit">提交</el-button></el-col>
        </el-row> -->
      </el-main>
    </el-container>
  </div>
</template>
<script setup>
import { onMounted, reactive, ref } from "vue";
import { ElMessageBox, ElMessage, ElLoading } from "element-plus";
import { getPerDetail, getPerMaintain } from "@/api/guarantee";
import { useRouter } from "vue-router";
import $tab from "@/plugins/tab.js";
const router = useRouter();
const route = useRoute();
const labelPosition = ref("right");
const { proxy } = getCurrentInstance();

const identity = ref(null);
const face = ref(null);
const bank = ref(null);
const frontUrl = ref(null); //正面
const frontList = ref([]); //正面预览
const versoUrl = ref(null); //反面
const versoList = ref([]); //反面预览
const loanInfo = ref({}); //

const options = [
  {
    value: "已婚",
    label: "已婚",
  },
  {
    value: "未婚",
    label: "未婚",
  },
  {
    value: "离异",
    label: "离异",
  },
];
const url = "https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg";

onMounted(() => {
  getDetail();
  console.log(route.query, "route.query");
});
function getDetail() {
  getPerDetail(route.query.id).then((res) => {
    console.log(res, "详情");
    if (res.code == 200) {
      loanInfo.value = res.data;
      frontUrl.value = "http://116.228.78.26:52800/nymanagerFile/" + loanInfo.value.frontIdcard;
      versoUrl.value = "http://116.228.78.26:52800/nymanagerFile/" + loanInfo.value.reverseIdcard;
      versoList.value.push(versoUrl.value);
      frontList.value.push(frontUrl.value);
      if (route.query.type == "66") {
        loanInfo.value.custName = route.query.names;
      }
    }
  });
}
function onSubmit() {
  getPerMaintain(loanInfo.value).then((res) => {
    if (res.code == 200) {
      proxy.$modal.msgSuccess(res.msg);
      getList();
    } else {
      proxy.$modal.msgWarning(res.msg);
    }
  });
}
// defineExpose({
//   getDetail,
// });
</script>

<style>
.demo-form-inline .el-input {
  --el-input-width: 220px;
}
</style>

<style lang="scss" scoped>
.customer {
  overflow: auto;
}
.bgc {
  background: #f2f2f2;
  margin-bottom: 5px;
  height: 30px;
  line-height: 30px;
  font-size: 16px;
}
.box1 {
  text-align: center;
  color: #999;
  border-bottom: 1.5px solid #e4e4e4;
  &:hover {
    cursor: pointer;
    color: #000;
  }
}
.mg-30 {
  margin-left: 100px;
}

:deep(.el-aside) {
  margin-top: 5px;
  background: #fff;
}
:deep(.el-main) {
  padding: 0;
  // flex: 80%;
}
.active {
  text-align: center;
  color: #000;
  border-bottom: 2px solid #000;
}
.personStyle {
  margin-right: 20px;
}
:deep(.el-form-item--default) {
  margin-bottom: 5px;
  width: 40%;
}
:deep(.el-select) {
  width: 100%;
}
:deep(.el-form-item) {
  margin-right: 120px;
}
.customer-right {
  position: fixed;
  border: 1px solid #e4e4e4;
  padding: 20px;
}

.item-mg {
  margin-top: 38px;
}
</style>
